#include<iostream>
using namespace std;
unsigned long long t;
int main(){
	cin>>t;
	t/=1000;
	int s=t%60;
	int m=(t/60)%60;
	int h=(t/3600)%24;
	printf("%02d:%02d:%02d",h,m,s);
	return 0;
}
